package cn.itsource.pet.domain;

import cn.itsource.basic.domain.BaseDomain;
import cn.itsource.org.domain.Shop;
import cn.itsource.user.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 实体类：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Pet extends BaseDomain{

    private String name;
    private BigDecimal costprice;
    private BigDecimal saleprice;
    /**
     * 类型id
     */
    private Long typeId;
    private String resources;
    /**
     * 状态：0下架 1上架
     */
    private Integer state = 0;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    private Date offsaletime;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    private Date onsaletime;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    private Date createtime=new Date();
    /**
     * 店铺Id 如果被领养店铺id为null
     */
    private Long shopId;

    /**
     * 如果被领养为领养用户id
     */
    private Long userId;
    //所属用户对象
    private User user;
    //所属店铺对象
    private Shop shop;
    //宠物类型对象 - 类型的名称
    private PetType petType;

    private Long searchMasterMsgId;

    //用字段的方式实现级联
    private String shopName;
    //用字段的方式实现级联
    private String userName;
    //用字段的方式实现级联
    private String parentName;

    //所属详情对象
    private PetDetail petDetail;

}
